import request from '@/utils/request'

// 查询产品制程物料BOM列表
export function listRouteproductbom(query) {
  return request({
    url: '/mes/pro/routeproductbom/list',
    method: 'get',
    params: query
  })
}

// 查询产品制程物料BOM详细
export function getRouteproductbom(recordId) {
  return request({
    url: '/mes/pro/routeproductbom/' + recordId,
    method: 'get'
  })
}

// 新增产品制程物料BOM
export function addRouteproductbom(data) {
  return request({
    url: '/mes/pro/routeproductbom',
    method: 'post',
    data: data
  })
}

// 修改产品制程物料BOM
export function updateRouteproductbom(data) {
  return request({
    url: '/mes/pro/routeproductbom',
    method: 'put',
    data: data
  })
}

// 删除产品制程物料BOM
export function delRouteproductbom(recordId) {
  return request({
    url: '/mes/pro/routeproductbom/' + recordId,
    method: 'delete'
  })
}

// 根据BOMID查询已保存过的BOM物料
export function getByBomId(bomId) {
  return request({
    url: '/mes/pro/routeproductbom/getByBomId',
    method: 'get',
    params: {
      bomId: bomId
    }
  })
}

// 批量更新工序物料
export function addBatch(rows) {
  return request({
    url: '/mes/pro/routeproductbom/addBatch',
    method: 'post',
    data: rows
  })
}


// 根据routeId查询已保存过的BOM物料
export function getByRouteId(routeId) {
  return request({
    url: '/mes/pro/routeproductbom/getByRouteId',
    method: 'get',
    params: {
      routeId: routeId
    }
  })
}

// 批量更新工序物料
export function routeBomBatch(rows) {
  return request({
    url: '/mes/pro/routeproductbom/routeBomBatch',
    method: 'post',
    data: rows
  })
}
